package net;

import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;


public class NetTest {
	
	public static void main(String[] args) throws Exception {
		Enumeration<NetworkInterface> netInterfaces = NetworkInterface.getNetworkInterfaces();
		InetAddress ip = null;
		while (netInterfaces.hasMoreElements()) {
			NetworkInterface ni = netInterfaces.nextElement();
			Enumeration<InetAddress> inets =  ni.getInetAddresses();
			System.out.println(new String(ni.getDisplayName()));
			while(inets.hasMoreElements()) {
				System.out.println(inets.nextElement());
			}
			
			
		
			
	
			
		}
	}
	
	 
}
